package it.fuesi.synoutils.services.client;

import it.fuesi.synoutils.model.base.VoidResponse;
import it.fuesi.synoutils.model.filestation.FileCopyMoveStartResponse;
import it.fuesi.synoutils.model.filestation.FileCopyMoveStatusResponse;
import it.fuesi.synoutils.model.filestation.FileStationListResponse;
import it.fuesi.synoutils.services.constants.Service;
import it.fuesi.synoutils.services.constants.ServiceType;
import retrofit.http.GET;
import retrofit.http.Query;

/**
 * Created by pascotto on 20/10/14.
 */
@ServiceType(Service.Synology)
public interface FileStationClient {



    //@GET("/webapi/FileStation/file_share.cgi?api=SYNO.FileStation.List&version=1&method=list_share&additional=real_path")
    //FileStationListResponse list(@Query("sid") String sid);

    @GET("/webapi/FileStation/file_share.cgi?api=SYNO.FileStation.List&version=1&method=list&additional=real_path&sort_by=name&sort_direction=asc&additional=size,type")
    FileStationListResponse list(@Query(value = "folder_path", encodeValue = false) String folder_path);

    @GET("/webapi/FileStation/file_share.cgi?api=SYNO.FileStation.List&version=1&method=list_share&additional=real_path")
    FileStationListResponse listShares();

    @GET("/webapi/FileStation/file_delete.cgi?api=SYNO.FileStation.Delete&version=1&method=delete")
    VoidResponse deleteFile(@Query(value = "path", encodeValue = false) String path);

    @GET("/webapi/FileStation/file_MVCP.cgi?api=SYNO.FileStation.CopyMove&version=1&method=start")
    FileCopyMoveStartResponse startCopyMove(@Query(value = "path", encodeValue = false) String path, @Query(value = "dest_folder_path", encodeValue = false) String dest_folder_path, @Query("remove_src") boolean remove_src, @Query("overwrite") boolean overwrite);


    @GET("/webapi/FileStation/file_MVCP.cgi?api=SYNO.FileStation.CopyMove&version=1&method=status")
    FileCopyMoveStatusResponse statusCopyMove(@Query("taskid") String taskid);

    @GET("/webapi/FileStation/file_crtfdr.cgi?api=SYNO.FileStation.CreateFolder&version=1&method=create")
    VoidResponse addFolder(@Query(value = "folder_path", encodeValue = false) String folder_path, @Query(value = "name", encodeValue = false) String name);

    @GET("/webapi/FileStation/file_rename.cgi?api=SYNO.FileStation.Rename&version=1&method=rename")
    VoidResponse renameFile(@Query(value = "path", encodeValue = false) String path, @Query(value = "name", encodeValue = false) String name);


}
